"""
@author: Sergiy Tsymbalyuk
"""

import logging

from pylons.i18n import lazy_ugettext as _
from repoze.what.plugins.pylonshq import ControllerProtector
from repoze.what.predicates import has_permission

from chowa.lib.site.crud import FlatCrudController
from chowa.model.auth import Group

log = logging.getLogger(__name__)

@ControllerProtector(has_permission('site.administer.security'))
class GroupsController(FlatCrudController):
    __model__ = Group
    __columns__ = ['name', 'description']
    __edit_columns__ = ['name', 'description', 'permissions']
    __main_heading__ = _('Security')
